﻿@model System.Collections.Generic.List<Best.SmartCms.Portal.Models.MenuViewModel>
<div class="menu" id="menu">
  <div class="wrap2 clear">
    <ul class="nav_ul clear">
      <li class="nav_li">
        <h2><a href="/home/index">首  页</a></h2>
      </li>
      <li class="nav_li">
        <h2><a href="/mall/index">在线商城</a></h2>
      </li>
      @foreach (var menugroup in Model)
      {
        var isGroupActive = ViewBag.CurrentMenuGroup == menugroup.GroupId;
        <li class="nav_li">
          <h2><a href="#" class="@($"{(isGroupActive ? "active" : "")}")">@menugroup.GroupName</a></h2>
          <div class="lists">
            <ul class="list_ul">
              @foreach (var menu in menugroup.Children)
              {
                <li class="list_li"><a href="/news/@menu.Url/@menu.Id">@menu.Name</a></li>
              }
            </ul>
          </div>
        </li>
      }
      <li class="nav_li">
        <h2><a href="/Contact/index">联系我们</a></h2>
      </li>
    </ul>
  </div>
</div>